package com.ruoyi.business.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.business.domain.bo.TalentpoolBo;
import com.ruoyi.business.domain.vo.TalentpoolVo;
import com.ruoyi.business.domain.Talentpool;
import com.ruoyi.business.mapper.TalentpoolMapper;
import com.ruoyi.business.service.ITalentpoolService;

import java.util.List;
import java.util.Map;
import java.util.Collection;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 员工Service业务层处理
 *
 * @author songzhengsheng
 * @date 2023-09-10
 */
@RequiredArgsConstructor
@Service
public class TalentpoolServiceImpl  extends ServiceImpl<TalentpoolMapper, Talentpool> implements ITalentpoolService {


    @Override
    public LambdaQueryWrapper<Talentpool> buildQueryWrapper(Talentpool bo) {
        LambdaQueryWrapper<Talentpool> lqw = Wrappers.lambdaQuery();
                    lqw.like(StringUtils.isNotBlank(bo.getFullName()), Talentpool::getFullName, bo.getFullName());
                    lqw.eq(StringUtils.isNotBlank(bo.getDepartment()), Talentpool::getDepartment, bo.getDepartment());
                    lqw.eq(StringUtils.isNotBlank(bo.getPosition()), Talentpool::getPosition, bo.getPosition());
                    lqw.eq(bo.getAge() != null, Talentpool::getAge, bo.getAge());
                    lqw.eq(StringUtils.isNotBlank(bo.getGender()), Talentpool::getGender, bo.getGender());
                    lqw.eq(StringUtils.isNotBlank(bo.getEthnicity()), Talentpool::getEthnicity, bo.getEthnicity());
                    lqw.eq(StringUtils.isNotBlank(bo.getIdNumber()), Talentpool::getIdNumber, bo.getIdNumber());
                    lqw.eq(StringUtils.isNotBlank(bo.getHomeAddress()), Talentpool::getHomeAddress, bo.getHomeAddress());
                    lqw.eq(StringUtils.isNotBlank(bo.getResidentialAddress()), Talentpool::getResidentialAddress, bo.getResidentialAddress());
                    lqw.eq(StringUtils.isNotBlank(bo.getContactNumber()), Talentpool::getContactNumber, bo.getContactNumber());
                    lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPerson()), Talentpool::getEmergencyContactPerson, bo.getEmergencyContactPerson());
                    lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactNumber()), Talentpool::getEmergencyContactNumber, bo.getEmergencyContactNumber());
                    lqw.eq(StringUtils.isNotBlank(bo.getEducation()), Talentpool::getEducation, bo.getEducation());
                    lqw.eq(StringUtils.isNotBlank(bo.getMajor()), Talentpool::getMajor, bo.getMajor());
                    lqw.eq(StringUtils.isNotBlank(bo.getRuralMedicalInsurance()), Talentpool::getRuralMedicalInsurance, bo.getRuralMedicalInsurance());
                    lqw.eq(StringUtils.isNotBlank(bo.getAccommodation()), Talentpool::getAccommodation, bo.getAccommodation());

                    lqw.eq(StringUtils.isNotBlank(bo.getSecondemployment()), Talentpool::getSecondemployment, bo.getSecondemployment());
                    lqw.eq(StringUtils.isNotBlank(bo.getImg()), Talentpool::getImg, bo.getImg());
                    lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), Talentpool::getRemarks, bo.getRemarks());
        return lqw;
    }

}
